<?php
//header("Content-type:text/html;charset=gbk");




//if(@!$_GET['csjhs'] || $_SESSION['sid']!=1)exit("这里什么都没有~");
?>


<head>
    <meta charset="UTF-8" />
	<title>Kana 找不到WinMail</title>
</head>
<p>limit : 查询条数 </p>
<div>pays%5B%5D 支付状态 </div>
<p>btime2:有效期<p>
<form action="" method="get">
    订单号:<input name='order_id' value='<?=$_GET['order_id']?>'>
    mid:<input name='mid' value='<?=$_GET['mid']?>'>
    aid:<input name='aid' value='<?=$_GET['aid']?>'>
    景区id:<input name='lid' value='<?=$_GET['lid']?>'>
    电话:<input name='contacttel' value='<?=$_GET['contacttel']?>'>
    area:<input name='area' value='<?=$_GET['area']?>'>
    <br/>
    查询条数:<input name='limit' value='<?=$_GET['limit']?$_GET['limit']:'5'?>'>
    票类id:<input name='tid' value='<?=$_GET['tid']?>'>
    <br/>
    时间类型:
    <select name='timetype'>
        <option value='1' <?if($_GET['timetype']=='1') echo '  selected="selected"';?>>下单时间</option>
        <option value='2' <?if($_GET['timetype']=='2') echo '  selected="selected"';?>>预计游玩</option>
        <option value='3' <?if($_GET['timetype']=='3') echo '  selected="selected"';?>>完成时间</option>
    </select>
    开始时间:<input type='date' name='begintime' value='<?=$_GET['begintime']?>'>
    结束时间:<input type='date' name='endtime' value='<?=$_GET['endtime']?>'>
    套票:<input type='' name='ifpack' value='<?=$_GET['ifpack']?>'>
    联票:<input type='' name='concat' value='<?=$_GET['concat']?>'>
    订单状态:<input type='' name='status' value='<?=$_GET['status']?>'>
    <br/>
    <input type='hidden' name='csjhs' value='11'>
    查询类型:
    <select name='c'>
    <option value='0' <?if($_GET['c']=='0') echo '  selected="selected"';?>>订单详情</option>
    <option value='1' <?if($_GET['c']=='1') echo '  selected="selected"';?>>订单总数</option>
    <option value='2' <?if($_GET['c']=='2') echo '  selected="selected"';?>>订单,票,金额总数</option>
    <option value='9' <?if($_GET['c']=='9') echo '  selected="selected"';?>>订单,票,金额总数(不含转分销)</option>
    </select>
    sid:<input type='' name='sid' value='<?=$_GET['sid']?>'>
    远端订单号:<input type='' name='remotenum' value='<?=$_GET['remotenum']?>'>
    ordermode:<input type='' name='ordermode' value='<?=$_GET['ordermode']?>'>
    支付方式:<input type='' name='pmode' value='<?=$_GET['pmode']?>'>
    <br/>
    <input type="submit" value="查询"/><br/>
   
<form>
<?
$mid=$_GET['mid'];
$aid = $_GET['aid'];
$order_id = $_GET['order_id'];
$lid = $_GET['lid'];
$tid = $_GET['tid'];
$time1=$_GET["begintime"]?$_GET["begintime"]:date("Y-m-d",strtotime('-1days'));
$time1= $time1." 00:00:00";
 echo "<br/>";
$time2=$_GET["endtime"]?$_GET["endtime"]:date("Y-m-d");
$time2 = $time2." 23:59:59";
switch ($_GET['timetype']) {
    case '1':
    default:
        $btime1 = $time1;
        $etime1 = $time2;
        break;
    case '2':
        $btime2 = $time1;
        $etime2 = $time2;
        break;
    case '3':
        $btime3 = $time1;
        $etime3 = $time2;
        break;

}
//$btime2 = $_GET['begintime2'] ? $_GET['begintime2'].' 00:00:00' : '';
//$etime2 = $_GET['endtime2'] ? $_GET['endtime2'].' 23:59:59' :'';
$sta=$_GET['status'];
$c=$_GET['c'] ? $_GET['c'] : '0';
$contacttel = $_GET['contacttel'];
$area = $_GET['area'];
$remotenum = $_GET['remotenum']+0 == 0 ? '' : $_GET['remotenum'];
$pm = $_GET['pmode'];
$pays = $_GET['pays'];
echo '<pre>';
print_r($pays);
echo '</pre>';
if(is_array($pays)){
    foreach($pays as $k => $v ){
        $pa .= $v.'|';
    }
    $pa = rtrim($pa,'|');
    echo $pa; echo "<br/>";
}

$limit =$_GET['limit']?$_GET['limit']:5;

//$s = new SoapClient(null,array(
//        "location" => "http://121.43.119.39/open/openService/pft_insideMX.php",
//        "uri" => "www.16u.com?ac_16u=16ucom|pw_16u=c33367701511b4f6020ec61ded352059|auth_16u=true")
//);

$s = new SoapClient(null,array(//112.124.14.164   121.43.119.39
        "location" => "http://121.43.119.39/open/openService/pft_insideMX.php",
        "uri" => "www.16u.com?ac_16u=16ucom|pw_16u=c33367701511b4f6020ec61ded352059|auth_16u=true")
);
echo "<br/>";
$atime = microtime(true);
if($c=='0'){
$x= simplexml_load_string(
    $s->Order_Globle_Search(
        $_GET['sid'],$mid, "$lid", "$tid", "", "", "$btime1", "$etime1", "$btime2", "$etime2",
        "$btime3", "$etime3", "$order_id", "", "$contacttel", "$sta", "$pa", "", "", "",
        "0", $limit, "$c", $_GET['ordermode'], "$pm", "0", "$remotenum", "0", "", "",
        $aid,$_GET['concat'],$_GET['ifpack'], "0","",'',''));
}else{
$x= $s->Order_Globle_Search(
    $_GET['sid'],$mid, "$lid", "$tid", "", "", "$btime1", "$etime1", "$btime2", "$etime2",
        "$btime3", "$etime3", "$order_id", "", "$contacttel", "$sta", "$pa", "", "", "",
        "0", $limit, "$c", $_GET['ordermode'], "$pm", "0", $remotenum, "0", "", "",
        $aid,$_GET['concat'],$_GET['ifpack'], "0",$area,'');
    var_dump($x);
}
echo '(
"'.$_GET['sid'].'","'.$mid.'", "'.$lid.'", "'.$tid.'", "", "", "'.$btime1.'", "'.$etime1.'", "'.$btime2.'", "'.$etime2.'",
        "'.$btime3.'", "'.$etime3.'", "'.$order_id.'", "", "'.$contacttel.'", "'.$sta.'", "'.$pa.'", "", "", "",
        "0", "'.$limit.'", "'.$c.'", "'.$_GET['ordermode'].'","'.$pm.'","0","'.$remotenum.'","0","","",
        "'.$aid.'","'.$_GET['concat'].'","'.$_GET['ifpack'].'","0","'.$area.'","")';
// $x= simplexml_load_string($s->Order_Globle_Search(
                        //"","", "", "", "", "", "2014-12-04 00:00:00", "2014-12-04 19:19:19", "", "",
                        // "", "", "", "", "", "", "", "", "", "1",
                        // "0", "1", "0", "0", "", "0", "", "0", "", "",
                        // "","0","0", "0", ""));
// $x= simplexml_load_string($s->Order_Globle_Search("",'',"","","","","","","","","","",442787,"","","","","",1,1,0,99,"","","","","","","","",6148,0,1));


echo '<pre>';
//if($c!=0)
    print_r($x);
//$cc = 0;
//foreach($x->Rec as $v){
//   if((int)$v->UUsellid==0){
//      echo $v->UUordernum,',';
//       break;
//       $order_arr[(int)$v->UUordernum]=1;
//   }
//}
//var_export($order_arr);
//echo count($order_arr);
//print_r($order_arr);
echo '</pre>';
echo  microtime(true) - $atime ;  

exit;
?>
 
